package com.rico.kok.service;

import com.rico.kok.entity.Follow;
import com.rico.kok.mapper.FollowMapper;
import com.rico.kok.service.interf.FollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class FollowServiceImpl implements FollowService {

    @Autowired
    FollowMapper followMapper;

    @Override
    @Transactional
    public int followUser(int userId, int followId) {
        return followMapper.followUser(userId,followId);
    }

    @Override
    public List<Integer> selectAllFollowsId(int userId) {
        return followMapper.selectAllFollowsId(userId);
    }

    @Override
    public List<Follow> selectAllFollows(int userId) {
        return followMapper.selectAllFollows(userId);
    }

    @Override
    public int unFollowUser(int userId, int unFollowId) {
        return followMapper.unFollowUser(userId,unFollowId);
    }
}
